package com.sbtr.business.trainingmodel.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sbtr.business.trainingmodel.entity.TrainingModelData;
import com.sbtr.common.PageDto;
import com.sbtr.open.trainingmodel.dto.ModelCountDto;
import com.sbtr.open.trainingmodel.dto.TrainingModelDataDto;
import com.sbtr.open.trainingmodel.dto.TrainingModelDataSearchDto;
import com.sbtr.overview.dto.AllCountDto;
import com.sbtr.overview.dto.ModelTypeCountDto;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 训练模型表 服务类
 * </p>
 *
 * @author yuyh2
 */
public interface ITrainingModelDataService extends IService<TrainingModelData> {

    PageDto<TrainingModelDataDto> search(TrainingModelDataSearchDto dto);

//	@RequestMapping(value = "/{id}/view-detail", method = RequestMethod.GET)
//	 DetailDto viewById(@PathVariable("id") Long id);

    TrainingModelDataDto findById(Long id);

    boolean deleteById(Long id);

    PageDto<TrainingModelDataDto> search(String modelName, Long currPage, Long pageSize, Long projectId);

    boolean publish(Long id);

    TrainingModelDataDto save(TrainingModelDataDto dto);

    /**
     * 生成数据预测模型
     *
     * @param id 模型id
     * @return oss下载链接
     * @throws IOException
     */
//	@RequestMapping(value = "/model-data-sdk/{id}", method = RequestMethod.GET)
//	 String modelDataSDK(@PathVariable("id") Long id) throws IOException;

    String modelDataSDK(Long id) ;


    // ===================新版本新增接口======================//
    TrainingModelDataDto findByTrainingTask(Long taskId);

    TrainingModelDataDto findPublishByProject(Long projectId);

    TrainingModelDataDto findByProjectId(Long projectId);


    TrainingModelDataDto findModelByProject(Long projectId);

    List<ModelCountDto> modelCountByProject(List<Long> projectIds);

//	@RequestMapping(value = "/get-history-model-by-project/{projectId}", method = RequestMethod.POST)
//	 List<HistoryModelDto> findHistoryModelByProjectId(@PathVariable("projectId") Long projectId,
//															 @RequestParam("page") Long currPage, @RequestParam("pageSize") Long pageSize);

    List<TrainingModelDataDto> trainMoedlStatus(int howLong);

    AllCountDto modelCount(String creater);
    List<ModelTypeCountDto> modelTypeCount(String creater);
}
